<?php
  require(dirname(__FILE__).'/global.php');
  require(ROOT.'/admin/isLogin.php');
  
  $submit = $_POST['submit'];
  if(!isset($submit)){
      $id = $_POST['id'];
      if(empty($id)){
          echo json_encode('传入参数不能为空!');
          exit();
      }
      $sql = "select * from talking_user where UserID = ".$id;
      $user = $db->query($sql);
      $message = "";
      $message .= "<h3>用户修改</h3>";
      $message .= "<fieldset>";
      $message .= "<form action='./basic.php' name='form' id='form' method='post'>";
      $message .= "<input type='hidden' name='submit' value='submit' /> ";
      $message .= "<p><label>用户名称:</label><input type='text' readonly class='text-long' value='".$user[0]['UserName']."' /></p>";
      $message .= "<p><label>用户密码:</label><input type='password' class='text-long' name='userpass' /></p>";
      $message .= "<p><label>真实姓名:</label><input type='text' readonly class='text-long' value='".$user[0]['UserRealName']."' /></p>";
      $message .= "<p><label>用户邮箱:</label><input type='text' readonly class='text-long' value='".$user[0]['UserEmail']."' /></p>";
      $message .= "<p><label>发帖数:</label><input type='text' readonly class='text-long' value='".$user[0]['UserPostNum']."' /></p>";
      $message .= "<p><label>用户组:</label><select name='usergroup' class='select'>";
      $message .= "<option value='3'>未认证会员</option><option value='4'>认证会员</option><option value='6'>管理员</option>";
      $message .= "</select></p>";
      $message .= "</form>";
      $message .= "</fieldset>";
      echo json_encode($message);
  }
  else{
  }                                 
?>